﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DataBound.aspx.cs" Inherits="DataBound" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 100%;" border="1px">
            <tr>
                <td width="100px">
                    Category
                </td>
                <td>
                    <asp:DropDownList ID="categoryDropList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="categoryDropList_SelectedIndexChanged" Width="200px">
                    </asp:DropDownList>
                    Tìm sản phẩm
                    <asp:TextBox ID="productNameText" runat="server"></asp:TextBox>
                    <asp:Button ID="searchButton" runat="server" onclick="searchButton_Click" Text="Tìm" />
                </td>
            </tr>
            <tr>
                <td>
                    Product DataList</td>
                <td>
                    &nbsp;<asp:DataList ID="DataList1" runat="server" OnEditCommand="DataList1_EditCommand" OnUpdateCommand="DataList1_UpdateCommand" BorderStyle="Solid" BorderWidth="1px" CellSpacing="5" RepeatColumns="3" oncancelcommand="DataList1_CancelCommand" ondeletecommand="DataList1_DeleteCommand">
                        <EditItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("ProductId") %>' ForeColor="#CC3300"></asp:Label>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("ProductName") %>'></asp:TextBox>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="update" CommandArgument='<%# Eval("ProductId") %>'>Update</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="cancel" CommandArgument='<%# Eval("ProductId") %>'>Cancel</asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("ProductId") %>' ForeColor="#CC3300"></asp:Label>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="select" CommandArgument='<%# Eval("ProductId") %>'>Select</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="edit" CommandArgument='<%# Eval("ProductId") %>'>Edit</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton3" runat="server" CommandName="delete">Delete</asp:LinkButton>
                        </ItemTemplate>
                        <AlternatingItemStyle BackColor="#CCCCCC" />
                        <AlternatingItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("ProductId") %>' ForeColor="#CC3300"></asp:Label>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="select" CommandArgument='<%# Eval("ProductId") %>'>Select</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="edit" CommandArgument='<%# Eval("ProductId") %>'>Edit</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton3" runat="server" CommandName="delete">Delete</asp:LinkButton>
                        </AlternatingItemTemplate>
                        <SelectedItemStyle BackColor="#00CCFF" />
                        <SelectedItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("ProductId") %>' ForeColor="#CC3300"></asp:Label>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="edit" CommandArgument='<%# Eval("ProductId") %>'>Edit</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton3" runat="server" CommandName="delete">Delete</asp:LinkButton>
                        </SelectedItemTemplate>
                    </asp:DataList>
                </td>
            </tr>
            <tr>
                <td>
                    Product GridView</td>
                <td>
                    Chưa xóa<br />
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" EnableModelValidation="True" ForeColor="#333333" GridLines="None" onpageindexchanging="GridView1_PageIndexChanging" onsorting="GridView1_Sorting" PageSize="2">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:CommandField ShowSelectButton="True" />
                            <asp:HyperLinkField DataNavigateUrlFields="ProductId" DataNavigateUrlFormatString="http://vnexpress.net/{0}" DataTextField="ProductId" DataTextFormatString="Mã {0}" HeaderText="Mã sản phẩm" SortExpression="ProductId" />
                            <asp:BoundField DataField="ProductName" HeaderText="Tên sản phẩm" />
                            <asp:BoundField DataField="UnitPrice" HeaderText="Giá" />
                            <asp:CheckBoxField DataField="Discontinued" HeaderText="Đã xóa" />
                            <asp:ImageField DataImageUrlField="ProductName" HeaderText="Hình sản phẩm">
                            </asp:ImageField>
                            <asp:CommandField ShowEditButton="True" />
                            <asp:CommandField ShowDeleteButton="True" />
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    </asp:GridView>
                    <br />
                    Đã xóa
                    <asp:GridView ID="GridView2" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" EnableModelValidation="True" ForeColor="#333333" GridLines="None" onpageindexchanging="GridView1_PageIndexChanging" onsorting="GridView1_Sorting" PageSize="2" EmptyDataText="Không có gì">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:CommandField ShowSelectButton="True" />
                            <asp:HyperLinkField DataNavigateUrlFields="ProductId" DataNavigateUrlFormatString="http://vnexpress.net/{0}" DataTextField="ProductId" DataTextFormatString="Mã {0}" HeaderText="Mã sản phẩm" SortExpression="ProductId" />
                            <asp:BoundField DataField="ProductName" HeaderText="Tên sản phẩm" />
                            <asp:BoundField DataField="UnitPrice" HeaderText="Giá" />
                            <asp:CheckBoxField DataField="Discontinued" HeaderText="Đã xóa" />
                            <asp:ImageField DataImageUrlField="ProductName" HeaderText="Hình sản phẩm">
                            </asp:ImageField>
                            <asp:CommandField ShowEditButton="True" />
                            <asp:CommandField ShowDeleteButton="True" />
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
